package com.dragon.logical.service.customer;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.dragon.repository.entity.AddPageData;
import com.dragon.repository.entity.Contract;
import com.dragon.repository.entity.Customer;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 客户表 服务类
 * </p>
 *
 * @author sy
 * @since 2023-06-16
 */
public interface CustomerService extends IService<Customer> {

    Page<Customer> selectCustomerList(String search, Integer status, Integer page, Integer limit, Integer applicationId, Integer settlement);

    AddPageData addCustomer(Customer customer);

    void updateCustomer(Customer customer);

    void deleteCustomerId(Integer id);

    void changeAdminId(Integer id, Integer adminId);

    Page<Contract> listId(Integer customerId);

    Customer selectDetailById(Integer id);

    Map<String, Object> newCustomerNub();

    void distinctCustomerName(String name);

    void updateAdminId(Integer id, Integer adminId);

    List<Customer> listByAdminId(Integer adminId,String search);

    /**
     * 删除
     * @param streamType 流程类型
     * @param correlationId 主表id
     */
    void deleteThorough(Integer streamType, Integer correlationId);

    /**
     * 反审核
     * @param correlationId
     */
    void antiAudit(Integer correlationId);

    Customer selectDetailByContractId(Integer contractId);

    void upgradeSettlement(Integer id);

    Page<Customer> selectCountContractBy(String name, String startTime, String endTime, Integer page, Integer limit);

    /**
     * 按照年月 查询成交的客户
     * @param name
     * @param startTime
     * @param endTime
     * @param page
     * @param limit
     * @return
     */
    Page<Customer> selectCountCustomerByYearMonth(String name, String startTime, String endTime, Integer page, Integer limit);
}
